/*
 *  QwertyKeyMapper.h
 *  Dictionary
 *
 *  Created by Rune Laugesen on 21/09/10.
 *  Copyright 2010 Copenhagen University. All rights reserved.
 *
 */

#ifndef Dictionary_QwertyKeyMapper_h
#define Dictionary_QwertyKeyMapper_h

#include "KeyMapper.h"
#include <set>

using namespace std;

class QwertyKeyMapper : public KeyMapper
{
private:
    //TODO: Use typedef for multimap<string, string>
    map<string, string> _mappedDictionary;
    BKTree _bktree;
    
    void BuildAlphabet(void);
    vector<string> GetMatchedMappings(string prefixkeys);
    vector<string> GetNextBestMappings(string keys);
    string StringToKeys(string* typeString);
    string GetEditDistance(string predict, string s, string t);
    //Obsolete - implemented in BKTree
    int GetLevenshteinDistance(string s, string t);
    
public:
    QwertyKeyMapper();
    void MapDictionary();    
    vector<string> GetMappings(string keys);
};

#endif